<?php

/**
 * MVM_MALL 网上商店系统  会员消费排行
 * ============================================================================
 * 版权所有 (C) 2007-2010 www.mvmmall.com，并保留所有权利。
 * 网站地址: http://www.mvmmall.com
 * ----------------------------------------------------------------------------
 * 这是一个免费开源的软件；这意味着您可以在不用于商业目的的前提下对程序代码
 * 进行修改、使用和再发布。
 * ============================================================================
 * $Author:  www.mvmmall.com  $
 * $Date: 2008-10-01 $
 * $Id: user_consumer.inc.php www.mvmmall.com$
 * ---------------------------------------------
*/

if(!defined('MVMMALL') || !defined('IN_ADMINCP')) exit('Access Denied');
if($action=='list'){
    $result = $db->query("SELECT SUM(order_amount) AS total_price,username,status FROM `{$tablepre}order_info` WHERE username <> '' AND status='7' GROUP BY username ORDER BY total_price DESC LIMIT 0,30");
    while($rt = $db->fetch_array($result)) {
        $member_list                = $db->get_one("SELECT member_id,member_name,member_email,member_tel1 FROM `{$tablepre}member_table` WHERE member_id = '$rt[username]'");
        $member_list['total_price'] = currency($rt['total_price']);
        $consumer_rt[]              = $member_list;
    }
    require_once template('user_consumer');
    footer();
}